package com.cz.zslu.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * <p>
 * 自定义类型
 * </p>
 *
 * @author 森森
 * @since 2018-12-05
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("custom_type")
public class CustomType extends SuperEntity<CustomType> {

    private static final long serialVersionUID = 1L;

    /**
     * 类型名称
     */
    @ApiModelProperty("类型名称")
    private String name;
    /**
     * 上级id
     */
    @ApiModelProperty("上级id")
    @TableField("p_id")
    private Long pId;
    /**
     * 用户id
     */
    @ApiModelProperty("用户id")
    @TableField("user_id")
    private Long userId;
    /**
     * 商户id
     */
    @ApiModelProperty("商户id")
    @TableField("store_id")
    private Long storeId;
    /**
     * 排序
     */
    @ApiModelProperty("排序")
    private Integer sort;


    /**
     * 下级
     */
    @ApiModelProperty("下级")
    @TableField(exist = false)
    private List<CustomType> subordinate = Lists.newArrayList();
}
